package com.tengju.data.domain.model.clickhouse;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 出货额类型
 */
@Getter
@AllArgsConstructor
public enum MoneyOutTypeEnum {

    WELFARE(1,"福三"),
    LEVEL4_GIFT(2,"黑钻套组"),
    LEVEL3_GIFT(3,"白金套组"),
    LEVEL2_GIFT(4,"粉卡套组"),
    OTHER(5,"其它");


    private Integer code;
    private String desc;

    public static MoneyOutTypeEnum parseByCode(Integer code) {
        return Arrays.stream(MoneyOutTypeEnum.values())
                .filter(v -> v.getCode().equals(code))
                .findFirst()
                .orElse(null);
    }
}
